var supplier = {
  add : function() {
    new WindowPanel({
      id: 'saveSupplier',
      title: '新增供应商信息',
      width: 620,
      height: 420,
      closeConfirm : true,
      maximizable: false,
      html : '<iframe name="supplierSaveFrame" id="supplierSaveFrame" src="'+projectName+'/purchase/supplier/toSave.t4m?'+getFlushParam('saveSupplier')+'" frameborder="0" scrolling="auto"></iframe>',
      tbar: new Toolbar({
        icon: 'image/op.gif',
        items : [{
          type : 'button',
          text : '保存',
          position: {
            a: '-80px 0px',
            b: '-80px -120px'
          },
          handler : function(){
            if(getFrame('supplierSaveFrame').validate()) {
              submitFrameForm('supplierSaveFrame', 'supplierForm');
            }
          }
        }]
      })
    });
  },
  update : function(id) {
	    new WindowPanel({
	        id: 'updateSupplier',
	        title: '修改供应商信息',
	        width: 620,
	        height: 420,
	        closeConfirm : true,
	        maximizable: false,
	        html : '<iframe name="supplierUpdateFrame" id="supplierUpdateFrame" src="'+projectName+'/purchase/supplier/toUpdate.t4m?'+getFlushParam('updateSupplier')+'&supplierId='+id+'" frameborder="0" scrolling="auto"></iframe>',
	        tbar: new Toolbar({
	          icon: 'image/op.gif',
	          items : [{
	            type : 'button',
	            text : '修改',
	            position: {
	              a: '-80px 0px',
	              b: '-80px -120px'
	            },
	            handler : function(){
	              if(getFrame('supplierUpdateFrame').validate()) {
	                submitFrameForm('supplierUpdateFrame', 'supplierForm');
	              }
	            }
	          }]
	        })
	      });
	    },
    view : function(id) {
        new WindowPanel({
          id: 'viewSupplier',
          title: '查看供应商信息',
          width: 650,
          height: 420,
          closeConfirm : true,
          maximizable: false,
          html : '<iframe name="supplierViewFrame" id="supplierViewFrame" src="'+projectName+'/purchase/supplier/toView.t4m?'+getFlushParam('viewSupplier')+'&supplierId='+id+'" frameborder="0" scrolling="auto"></iframe>',
          tbar: new Toolbar({
            icon: 'image/op.gif',
            items : [{
              type : 'button',
              text : '打印',
              position: {
                a: '-80px 0px',
                b: '-80px -120px'
              },
              handler : function(){
                
              }
            }]
          })
        });
      }
};